<?php
namespace app\circularLinkedList\controller;
use think\Controller;
class Tests extends Controller
{
    public $circularLinkedList = null;
    public function _initialize()
    {
        parent::_initialize();
        $this->circularLinkedList = new CircularLinkedList();
    }

    public function look()
    {
        // 测试
        $linkedList = new CircularLinkedList('header');
        $linkedList->insert('header', 'China');
        $linkedList->insert('China', 'USA');
        $linkedList->insert('USA', 'England');
        $linkedList->insert('England', 'Australia');
        echo '链表为：';
        $linkedList->display();
        echo "</br>";
        echo '-----删除节点USA-----';
        echo "</br>";
        $linkedList->delete('USA');
        echo '链表为：';
        $linkedList->display();
//// 输出：
//        链表为：China   USA   England   Australia
//    -----删除节点USA-----
//链表为：China   England   Australia
    }
}